home *** CD-ROM | disk | FTP | other *** search
- Path: news.infi.net!usenet
- From: Scott Hightower <hightowr@lex.infi.net>
- Newsgroups: comp.lang.c++
- Subject: Re: what does this code do?
- Date: Sat, 06 Apr 1996 20:59:25 -0500
- Organization: InfiNet
- Message-ID: <3167217D.AC7@lex.infi.net>
- References: <4k6u2v$i2c@newsbf02.news.aol.com>
- NNTP-Posting-Host: h-adenoma.lex.infi.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Mrdavc wrote:
- >
- > linePtrs[currentLine][lineLen[currentLine]] = (char) key;
- >
- > What does this code do? It looks like linePtrs is a multidimensional
- > array but its not defined that way. is both linePtrs[currentLine] and
- > lineLen[currentLine] set to (char) key??
- >
- > example from Teach yourself Turbo C++ 4.5 for Windows by Craig Arnush
- > p,355
-
- Sorry, don't have the book avail to confirm this, but sounds like linePtrs
- is an array of pointers to lines, which are themselves char[]. And
- currentLine is an index into the array of pointers and another array of
- lengths for each line. So if currentLine=1423, and lineLen[1423]=64,
- key is cast to char and placed at index 64 of the char array pointed to
- by linePtrs[1423]. And then probably lineLen[1423] is incremented.
-
-